package tech.aistar.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 本类用来演示:
 *
 * @author jyz
 * @date 2023/3/11 20:10:31
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result{
    private Boolean success;  // 是否成功
    private String errorMessage;    // 返回错误消息
    private Object data;    // 返回数据
    public static Result ok(){
        return new Result(true,null,null);
    }
    public static Result ok(Object data){
        return new Result(true,null,data);
    }
    public static Result fail(String errorMessage){
        return new Result(false,errorMessage,null);
    }
}
